import { Controller, Post, Body } from '@nestjs/common';
import { TodoListService } from './todoList.service';
import { NestLogger } from 'nest-logs';

// 日志
@NestLogger()
@Controller('/todo-list')
export class TodoListController {
  constructor(private readonly appService: TodoListService) {}
  // 创建待办
  @Post('/add-todo-list')
  createTodoList(@Body() params): Promise<any> {
    return this.appService.createTodo(params);
  }
  // 获取待办列表
  @Post('/get-todo-list-list')
  getTodoList(@Body() params): Promise<any> {
    return this.appService.getTodoList(params);
  }
  //完成待办
  @Post('finish-todo-list')
  finishTodoList(@Body() params): Promise<any> {
    return this.appService.finishTodo(params);
  }
  //完成待办
  @Post('delete-todo-list')
  deleteTodo(@Body() params): Promise<any> {
    return this.appService.deleteTodo(params);
  }
  //编辑待办
  @Post('edit-todo-list')
  editTodo(@Body() params): Promise<any> {
    return this.appService.editTodo(params);
  }
}
